package o;

import android.app.Activity;
import com.huawei.appgallery.agreement.api.ui.ITermsActivityProtocol;

public class aym {
    private static String ˎ = "";
    private ITermsActivityProtocol ˊ;
    private boolean ˋ;

    private aym() {
    }

    public static void ॱ(Activity activity, ITermsActivityProtocol iTermsActivityProtocol, awt o_awt) {
        ˎ = ays.ˊ();
        new aym().ˎ(activity, iTermsActivityProtocol, o_awt);
    }

    private void ˎ(Activity activity, ITermsActivityProtocol iTermsActivityProtocol, final awt o_awt) {
        this.ˊ = iTermsActivityProtocol;
        if (this.ˊ != null) {
            this.ˋ = this.ˊ.isSignForUser();
        }
        ॱ(activity, iTermsActivityProtocol, new axt(this) {
            final /* synthetic */ aym ˊ;

            public void ˏ() {
                this.ˊ.ˋ(true);
                o_awt.ॱ(true);
            }

            public void ॱ() {
                this.ˊ.ˋ(false);
                o_awt.ॱ(false);
            }
        });
    }

    private void ॱ(Activity activity, ITermsActivityProtocol iTermsActivityProtocol, axt o_axt) {
        axp.ॱ().ˋ(ˎ, activity, iTermsActivityProtocol, null, o_axt);
    }

    public static void ˊ(Activity activity) {
        axp.ॱ().ॱ(activity, ˎ);
    }

    private void ˋ(boolean z) {
        awg.ˎ.ˋ("ShowTermsDialog", "doSignResult, isSigned: " + z + ", isSignForUser: " + this.ˋ);
        ayn.ˎ(ˎ, z);
        if (this.ˋ) {
            ayn.ˏ(ˎ, z);
            if (z) {
                new ayf(true).ˊ();
            }
        }
    }
}
